import React from 'react';

import {

} from 'react-native';

import BaseAction from '../common/BaseAction';
import Constants from '../../common/Constants';
import ToastUtils from '../../common/ToastUtils';
import Config from '../../config';

export default class JumpToPageByNotification extends BaseAction {
  constructor() {
    super();
    this.moduleType = Constants.MODULE_TYPE.COMMON;
    this.name = "JumpToPageByNotification";
  }

  finish() {
    // ToastUtils.show("JumpToPageByNotification" + JSON.stringify(this.data));
    if(this.data.notice_type == "1") {//爱情事私聊
      //{"aps":{"alert":"222"},"notice_type":"1","_j_uid":11146571352,"love_id":"595f8*****","_j_msgid":4823848032***,"_j_business":1}
      // let data = {"msguser_id":"5937b4e3ffc3c47dc2527a0a", type:1};
      let data = {"msguser_id":this.data.love_id, type:1};
      this.caller.gotoPage(Config.pages.heart_love_chat, data);
    }  else if (this.data.notice_type == "2") {//新闻通||社会云||生活汇
      this.caller.gotoPage(Config.pages.news_content, {news_id:this.data.news_id});
    } else if (this.data.notice_type == "3") {
       this.caller.gotoPage(Config.pages.activity_content, {activity_id:this.data.activity_id});
    } else if (this.data.notice_type == "4") {
      this.caller.gotoPage(Config.pages.ad_Webview, {slide_url:this.data.slide_url});
    }else if (this.data.notice_type == "9") {
      this.caller.gotoPage(Config.pages.sport_dibiao_detail, {landmark_id:this.data.landmark_id});
    }
  }
}
